package tsg.util;


@SuppressWarnings("unused")
public class OperatingSystem 
{
	public  static final int    UNKNOWN		    = 0;
	public  static final int    LINUX 		    = 1;
	public  static final int    WINDOWS 	    = 2;
	public  static final int    MAC 		    = 3;
	public  static final int    IOS 		    = 4;
	public  static final int    ANDROID 	    = 5;
	
	private static final String LINUX_NAME 		= "linux";
	private static final String WINDOWS_NAME 	= "windows";
	private static final String MAC_NAME 		= "osx";
	private static final String IOS_NAME 		= "ios";
	private static final String ANDROID_NAME 	= "android";
	
	private OperatingSystem()
	{
		String 	osName = System.getProperty("os.name").toLowerCase();

		if(osName.contains(ANDROID_NAME) == true)
		{
			_os = ANDROID;
		}
		else if(osName.contains(LINUX_NAME) == true)
		{
			_os = LINUX;
		}
		else if(osName.contains(WINDOWS_NAME) == true)
		{
			_os = WINDOWS;
		}
		else if(osName.contains(MAC_NAME) == true)
		{
			_os = MAC;
		}
		else if(osName.contains(IOS_NAME) == true)
		{
			_os = IOS;
		}
		
	}
	
	public static int getOperatingSystem()
	{
		return _os;
	}
	
	private static int 				_os 		= UNKNOWN;
	private static OperatingSystem 	_singleton 	= new OperatingSystem();
}
